GithubHelp home page GithubHelp logo

adbs_lab's Introduction

姓名:熊荣康

学号:SA21229005

简单的存储和缓冲区管理器

├── ./autorun.sh
├── ./build
│   └── ./build/linux
│       └── ./build/linux/x86_64
│           └── ./build/linux/x86_64/release
│               ├── ./build/linux/x86_64/release/adbs_lab
│               ├── ./build/linux/x86_64/release/adbs_lab_multi_thread
│               └── ./build/linux/x86_64/release/test.dbf
├── ./data
│   └── ./data/data-5w-50w-zipf.txt
├── ./doc
│   ├── ./doc/adbs-lab.pdf
│   └── ./doc/adbs-project-zh.md
├── ./include
│   ├── ./include/argparse
│   │   └── ./include/argparse/argparse.h
│   ├── ./include/BufferPoolManager.h
│   ├── ./include/ClockReplacer.h
│   ├── ./include/cmdline.h
│   ├── ./include/Common.h
│   ├── ./include/DataStorageManager.h
│   ├── ./include/LRUReplacer.h
│   ├── ./include/Page.h
│   └── ./include/Replacer.h
├── ./LICENSE
├── ./README.md
├── ./src
│   ├── ./src/BufferPoolManager.cpp
│   ├── ./src/ClockReplacer.cpp
│   ├── ./src/DataStorageManager.cpp
│   └── ./src/LRUReplacer.cpp
├── ./test
│   ├── ./test/main.cpp (single thread)
│   └── ./test/main_multi_thread.cpp    (multi thread)
└── ./xmake.lua

使用

mkdir build;
cd build;
xmake -P .;

实现结果(包括设计结果、实现结果、运行结果等)

run

single thread

cd build/linux/x86_64/release/;
./adbs_lab -l -f /home/rongkang/WorkSpace/HomeWork/adbs_lab/data/data-5w-50w-zipf.txt;
cd build/linux/x86_64/release/;
./adbs_lab -c -f /home/rongkang/WorkSpace/HomeWork/adbs_lab/data/data-5w-50w-zipf.txt;

multiple threads

10 threads lru

cd build/linux/x86_64/release/;
./adbs_lab_multi_thread -l -t 10 -f /home/rongkang/WorkSpace/HomeWork/adbs_lab/data/data-5w-50w-zipf.txt;

20 threads lru

cd build/linux/x86_64/release/;
./adbs_lab_multi_thread -l -t 20 -f /home/rongkang/WorkSpace/HomeWork/adbs_lab/data/data-5w-50w-zipf.txt;

30 threads lru

cd build/linux/x86_64/release/;
./adbs_lab_multi_thread -l -t 30 -f /home/rongkang/WorkSpace/HomeWork/adbs_lab/data/data-5w-50w-zipf.txt;

40 threads lru

cd build/linux/x86_64/release/;
./adbs_lab_multi_thread -l -t 40 -f /home/rongkang/WorkSpace/HomeWork/adbs_lab/data/data-5w-50w-zipf.txt;

10 threads clock

cd build/linux/x86_64/release/;
./adbs_lab_multi_thread -c -t 10 -f /home/rongkang/WorkSpace/HomeWork/adbs_lab/data/data-5w-50w-zipf.txt;

20 threads clock

cd build/linux/x86_64/release/;
./adbs_lab_multi_thread -c -t 20 -f /home/rongkang/WorkSpace/HomeWork/adbs_lab/data/data-5w-50w-zipf.txt;

30 threads clock

cd build/linux/x86_64/release/;
./adbs_lab_multi_thread -c -t 30 -f /home/rongkang/WorkSpace/HomeWork/adbs_lab/data/data-5w-50w-zipf.txt;

results

thread replacer hit number hit rate io number time
1 lru 169565 33.91% 502821 0.95s
1 clock 169565 33.91% 502821 2.11s
10 lru 2007256 40.15% 4555873 51.81s
20 lru 4421657 44.22% 8489680 121.78s
30 lru 6704605 44.70% 12624313 205.05s
40 lru 8392585 41.96% 17667722 254.76s
10 clock 2127384 42.55% 4368532 144.28s
20 clock 4339470 43.39% 8611720 405.87s
30 clock 6508731 43.39% 12916270 630.45s
  • 在单线程情况下,lru和clock算法的hit rate是一样的,但是lru算法用时更短
  • 在多线程情况下,线程数少的时候clock的hit rate更高,但是用时多了一个倍
  • 在多线程情况下,线程数多的时候lru的hit rate更高,同时用时更短

压缩文件

tar -zcvf ../SA21229005-熊荣康-lab.tar.gz ./*

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.