Skip to content

Commit

Permalink
feat: added more intel processors
Browse files Browse the repository at this point in the history
  • Loading branch information
zleyyij committed Jan 25, 2024
1 parent 2f821d1 commit 6054193
Show file tree
Hide file tree
Showing 19 changed files with 2,193 additions and 966 deletions.
7 changes: 5 additions & 2 deletions src/cpu.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::collections::HashMap;

use levenshtein::levenshtein;
use serde::Serialize;
use log::debug;
use serde::Serialize;
mod amd;
mod intel;

Expand Down Expand Up @@ -65,7 +65,10 @@ impl CpuCache {
best_fit = cpu.clone();
}
}
debug!("Given the input: {:?}, the CPU {:?} was found", input, best_fit.name);
debug!(
"Given the input: {:?}, the CPU {:?} was found",
input, best_fit.name
);
best_fit
}
}
Expand Down
327 changes: 189 additions & 138 deletions src/cpu/intel/chunks/1.csv

Large diffs are not rendered by default.

139 changes: 139 additions & 0 deletions src/cpu/intel/chunks/10.csv

Large diffs are not rendered by default.

135 changes: 135 additions & 0 deletions src/cpu/intel/chunks/11.csv

Large diffs are not rendered by default.

105 changes: 105 additions & 0 deletions src/cpu/intel/chunks/12.csv

Large diffs are not rendered by default.

111 changes: 111 additions & 0 deletions src/cpu/intel/chunks/13.csv

Large diffs are not rendered by default.

95 changes: 95 additions & 0 deletions src/cpu/intel/chunks/14.csv

Large diffs are not rendered by default.

132 changes: 132 additions & 0 deletions src/cpu/intel/chunks/15.csv

Large diffs are not rendered by default.

287 changes: 146 additions & 141 deletions src/cpu/intel/chunks/2.csv

Large diffs are not rendered by default.

306 changes: 173 additions & 133 deletions src/cpu/intel/chunks/3.csv

Large diffs are not rendered by default.

245 changes: 141 additions & 104 deletions src/cpu/intel/chunks/4.csv

Large diffs are not rendered by default.

242 changes: 147 additions & 95 deletions src/cpu/intel/chunks/5.csv

Large diffs are not rendered by default.

317 changes: 183 additions & 134 deletions src/cpu/intel/chunks/6.csv

Large diffs are not rendered by default.

155 changes: 155 additions & 0 deletions src/cpu/intel/chunks/7.csv

Large diffs are not rendered by default.

149 changes: 149 additions & 0 deletions src/cpu/intel/chunks/8.csv

Large diffs are not rendered by default.

146 changes: 146 additions & 0 deletions src/cpu/intel/chunks/9.csv

Large diffs are not rendered by default.

214 changes: 0 additions & 214 deletions src/cpu/intel/input.csv

This file was deleted.

45 changes: 41 additions & 4 deletions src/cpu/intel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,58 @@ mod parser;
// selecting a filter that includes every single processor (eg, 1 core to [max] cores) -> Compare all -> Compare -> Export Comparison

// update: I have found the best way to actually get every cpu is to go through the process of loading every cpu onto your webpage, find the table element containing
// all of the cpus -> right click -> create global variable -> iterate over `temp1.children` and extract`element.getAttribute("data-product-id")
// all of the cpus -> right click -> Store as global variable -> iterate over `temp1.children` and extract`element.getAttribute("data-product-id")
// from there, you can generate a list of urls based off of <https://ark.intel.com/content/www/us/en/ark/compare.html?productIds=> and that list of ids
// you generated earlier.
// You can also apparently extract an sqlite DB from the android app <https://github.com/issy/intel-ark-api>, that may be worth looking into,
// although when i checked, it looked slightly out of date
/*
Below is copy-pasteable javascript to export stuff
```javascript
// (in chrome) open inspect element, select a table element, and look for the `tbody`
// that contains all of the cpu `tr`s, right click -> store as global variable.
// this should create `temp1` in your terminal
// then paste the below in:
let ids = [];
for (const element of temp1.children) {
ids.push(element.getAttribute("data-product-id"));
}
console.log(ids.join(","));
```
Below is copy-pasteable javascript to generate a list of urls from that
wall of ids you found (i used deno)
```
let ids = [PASTE_IDS_HERE];
// https://stackoverflow.com/questions/8495687/split-array-into-chunks
let chunks = ids.reduce((all,one,i) => {
const ch = Math.floor(i/200);
all[ch] = [].concat((all[ch]||[]),one);
return all
}, []);
for (const chunk of chunks) {
console.log("https://ark.intel.com/content/www/us/en/ark/compare.html?productIds=" + chunk.join(","));
}
```
*/

// this list should contain every intel core processor (not ultra) up till 14th gen
// TODO: make this list contain *every* intel processor
const CHUNKS: [&str; 6] = [
// this list should contain every intel processor till the beginning of 2024
const CHUNKS: [&str; 15] = [
include_str!("chunks/1.csv"),
include_str!("chunks/2.csv"),
include_str!("chunks/3.csv"),
include_str!("chunks/4.csv"),
include_str!("chunks/5.csv"),
include_str!("chunks/6.csv"),
include_str!("chunks/7.csv"),
include_str!("chunks/8.csv"),
include_str!("chunks/9.csv"),
include_str!("chunks/10.csv"),
include_str!("chunks/11.csv"),
include_str!("chunks/12.csv"),
include_str!("chunks/13.csv"),
include_str!("chunks/14.csv"),
include_str!("chunks/15.csv"),
];

pub fn get_intel_cpus() -> Vec<Cpu> {
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ impl log::Log for SimpleLogger {
fn enabled(&self, metadata: &Metadata) -> bool {
// determine at what level things will be logged at
// TODO: make this configurable via environment variable
metadata.level() <= Level::Info
metadata.level() <= Level::Error
}

fn log(&self, record: &Record) {
Expand Down

0 comments on commit 6054193

Please sign in to comment.