View Single Post
Old 07-08-12, 11:13 AM   #11
KDE
Registered User
 
Join Date: Nov 2007
Posts: 50
Default Re: Support for X32 ABI

People who would need 32-bit would use long-lived branch.
32-bit can be faster than 64-bit. This is also reason that X32 is needed.

Following test needs 49% more memory and 18% more time on x86-64 than on X32

x86-64
Elapsed time: 736 ms
Memory usage: VmRSS: 51868 kB

X32
Elapsed time: 623 ms
Memory usage: VmRSS: 34788 kB


Code:
#include <QtCore>
#include <set>
#include <stdlib.h>

using namespace std;
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);
    QTextStream out(stdout);
    set<int> loset;
    int count = 1024 * 1024;
    QTime time;
    time.start();
    while (count--) {
        loset.insert(random());
    }
    out << "Elapsed time: " << time.elapsed() << " ms" << endl;
    QFile status("/proc/self/status");
    status.open(QIODevice::ReadOnly);
    QTextStream loin(&status);
    auto lobuf = loin.readAll().split('\n');
    for (auto && Loit = lobuf.constBegin(); Loit != lobuf.constEnd(); Loit++) {
        if (Loit->contains("VmRSS")) {
            out << "Memory usage: " <<  *Loit << endl;
        }
    }
    loset.clear();

}
KDE is offline   Reply With Quote